//ITMD536 Software Testing and Maintenance.
//Final project <group assignment>
//Author: Wanglei ID:A20479012
#ifndef _FACECOMMON_H
#define _FACECOMMON_H
 typedef enum returnval{
    faceDetectError=-1,
    faceRecognitionError,
    faceLandmarkError,
    facePnetError,
    faceRnetError,
    faceOnetError,
	faceError,
    faceNormal=0
}ReturnVal;

//face feature value numbers & 
//face landmark points numbers definitions.
#define FACED_FEATURE_LEN 512
#define LM_FEATURE_LEN 106

//face landmark aligned width & height.
#define LM_ALIGNED_W 112
#define LM_ALIGNED_H 112

//face aligned width & height.
#define FACE_ALIGNED_W 112
#define FACE_ALIGNED_H 112

//regpersion value and compare score definition.
#define REGPERSION_SIZE 32
#define COMPARE_SCORE 0.70

//face detect landmark
typedef struct tface_landmark
{
	float x[5];
	float y[5];
}face_landmark;
//Bbox for face detect func.
typedef struct tBbox
{
	float score;
	int x1;
	int y1;
	int x2;
	int y2;
	float area;
	//float ppoint[10];
	face_landmark landmark;
	float regreCoord[4];
}Bbox;
//FaceBox for face recognize funcs.
typedef struct tFaceBox
{
	float x0;
	float y0;
	float x1;
	float y1;
	face_landmark landmark;
}FaceBox;
//structure of face recognize result.
typedef struct tFaceRecType
{
	FaceBox box;//detect out for recognize
	float features[FACED_FEATURE_LEN];
} FaceRecType;
//structure of face landmark result.
typedef struct tFaceLmkType
{
	FaceBox box;//detect out for landmark
	float lx[LM_FEATURE_LEN];
	float ly[LM_FEATURE_LEN];
} FaceLmkType;

#define INSERT_DATA "INSERT INTO FACE_FEATURES VALUES " \
	"(\"%s\",\"%s\",%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%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%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f," \
	"%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f)"

#define SELECT_VALUE "SELECT VALUE1,	VALUE2,	VALUE3,	VALUE4,	VALUE5,	VALUE6,	VALUE7,	VALUE8,	VALUE9,	VALUE10,	VALUE11,	VALUE12,	VALUE13,	VALUE14,	VALUE15,	VALUE16,	VALUE17,	VALUE18,	VALUE19,	VALUE20,	VALUE21,	VALUE22,	VALUE23,	VALUE24,	VALUE25,	VALUE26,	VALUE27,	VALUE28,	VALUE29,	VALUE30,	VALUE31,	VALUE32,	VALUE33,	VALUE34,	VALUE35,	VALUE36,	VALUE37,	VALUE38,	VALUE39,	VALUE40,	VALUE41,	VALUE42,	VALUE43,	VALUE44,	VALUE45,	VALUE46,	VALUE47,	VALUE48,	VALUE49,	VALUE50,	VALUE51,	VALUE52,	VALUE53,	VALUE54,	VALUE55,	VALUE56,	VALUE57,	VALUE58,	VALUE59,	VALUE60,	VALUE61,	VALUE62,	VALUE63,	VALUE64,	VALUE65,	VALUE66,	VALUE67,	VALUE68,	VALUE69,	VALUE70,	VALUE71,	VALUE72,	VALUE73,	VALUE74,	VALUE75,	VALUE76,	VALUE77,	VALUE78,	VALUE79,	VALUE80,	VALUE81,	VALUE82,	VALUE83,	VALUE84,	VALUE85,	VALUE86,	VALUE87,	VALUE88,	VALUE89,	VALUE90,	VALUE91,	VALUE92,	VALUE93,	VALUE94,	VALUE95,	VALUE96,	VALUE97,	VALUE98,	VALUE99,	VALUE100,	VALUE101,	VALUE102,	VALUE103,	VALUE104,	VALUE105,	VALUE106,	VALUE107,	VALUE108,	VALUE109,	VALUE110,	VALUE111,	VALUE112,	VALUE113,	VALUE114,	VALUE115,	VALUE116,	VALUE117,	VALUE118,	VALUE119,	VALUE120,	VALUE121,	VALUE122,	VALUE123,	VALUE124,	VALUE125,	VALUE126,	VALUE127,	VALUE128," \
	"VALUE129,	VALUE130,	VALUE131,	VALUE132,	VALUE133,	VALUE134,	VALUE135,	VALUE136,	VALUE137,	VALUE138,	VALUE139,	VALUE140,	VALUE141,	VALUE142,	VALUE143,	VALUE144,	VALUE145,	VALUE146,	VALUE147,	VALUE148,	VALUE149,	VALUE150,	VALUE151,	VALUE152,	VALUE153,	VALUE154,	VALUE155,	VALUE156,	VALUE157,	VALUE158,	VALUE159,	VALUE160,	VALUE161,	VALUE162,	VALUE163,	VALUE164,	VALUE165,	VALUE166,	VALUE167,	VALUE168,	VALUE169,	VALUE170,	VALUE171,	VALUE172,	VALUE173,	VALUE174,	VALUE175,	VALUE176,	VALUE177,	VALUE178,	VALUE179,	VALUE180,	VALUE181,	VALUE182,	VALUE183,	VALUE184,	VALUE185,	VALUE186,	VALUE187,	VALUE188,	VALUE189,	VALUE190,	VALUE191,	VALUE192,	VALUE193,	VALUE194,	VALUE195,	VALUE196,	VALUE197,	VALUE198,	VALUE199,	VALUE200,	VALUE201,	VALUE202,	VALUE203,	VALUE204,	VALUE205,	VALUE206,	VALUE207,	VALUE208,	VALUE209,	VALUE210,	VALUE211,	VALUE212,	VALUE213,	VALUE214,	VALUE215,	VALUE216,	VALUE217,	VALUE218,	VALUE219,	VALUE220,	VALUE221,	VALUE222,	VALUE223,	VALUE224,	VALUE225,	VALUE226,	VALUE227,	VALUE228,	VALUE229,	VALUE230,	VALUE231,	VALUE232,	VALUE233,	VALUE234,	VALUE235,	VALUE236,	VALUE237,	VALUE238,	VALUE239,	VALUE240,	VALUE241,	VALUE242,	VALUE243,	VALUE244,	VALUE245,	VALUE246,	VALUE247,	VALUE248,	VALUE249,	VALUE250,	VALUE251,	VALUE252,	VALUE253,	VALUE254,	VALUE255,	VALUE256," \
	"VALUE257,	VALUE258,	VALUE259,	VALUE260,	VALUE261,	VALUE262,	VALUE263,	VALUE264,	VALUE265,	VALUE266,	VALUE267,	VALUE268,	VALUE269,	VALUE270,	VALUE271,	VALUE272,	VALUE273,	VALUE274,	VALUE275,	VALUE276,	VALUE277,	VALUE278,	VALUE279,	VALUE280,	VALUE281,	VALUE282,	VALUE283,	VALUE284,	VALUE285,	VALUE286,	VALUE287,	VALUE288,	VALUE289,	VALUE290,	VALUE291,	VALUE292,	VALUE293,	VALUE294,	VALUE295,	VALUE296,	VALUE297,	VALUE298,	VALUE299,	VALUE300,	VALUE301,	VALUE302,	VALUE303,	VALUE304,	VALUE305,	VALUE306,	VALUE307,	VALUE308,	VALUE309,	VALUE310,	VALUE311,	VALUE312,	VALUE313,	VALUE314,	VALUE315,	VALUE316,	VALUE317,	VALUE318,	VALUE319,	VALUE320,	VALUE321,	VALUE322,	VALUE323,	VALUE324,	VALUE325,	VALUE326,	VALUE327,	VALUE328,	VALUE329,	VALUE330,	VALUE331,	VALUE332,	VALUE333,	VALUE334,	VALUE335,	VALUE336,	VALUE337,	VALUE338,	VALUE339,	VALUE340,	VALUE341,	VALUE342,	VALUE343,	VALUE344,	VALUE345,	VALUE346,	VALUE347,	VALUE348,	VALUE349,	VALUE350,	VALUE351,	VALUE352,	VALUE353,	VALUE354,	VALUE355,	VALUE356,	VALUE357,	VALUE358,	VALUE359,	VALUE360,	VALUE361,	VALUE362,	VALUE363,	VALUE364,	VALUE365,	VALUE366,	VALUE367,	VALUE368,	VALUE369,	VALUE370,	VALUE371,	VALUE372,	VALUE373,	VALUE374,	VALUE375,	VALUE376,	VALUE377,	VALUE378,	VALUE379,	VALUE380,	VALUE381,	VALUE382,	VALUE383,	VALUE384," \
	"VALUE385,	VALUE386,	VALUE387,	VALUE388,	VALUE389,	VALUE390,	VALUE391,	VALUE392,	VALUE393,	VALUE394,	VALUE395,	VALUE396,	VALUE397,	VALUE398,	VALUE399,	VALUE400,	VALUE401,	VALUE402,	VALUE403,	VALUE404,	VALUE405,	VALUE406,	VALUE407,	VALUE408,	VALUE409,	VALUE410,	VALUE411,	VALUE412,	VALUE413,	VALUE414,	VALUE415,	VALUE416,	VALUE417,	VALUE418,	VALUE419,	VALUE420,	VALUE421,	VALUE422,	VALUE423,	VALUE424,	VALUE425,	VALUE426,	VALUE427,	VALUE428,	VALUE429,	VALUE430,	VALUE431,	VALUE432,	VALUE433,	VALUE434,	VALUE435,	VALUE436,	VALUE437,	VALUE438,	VALUE439,	VALUE440,	VALUE441,	VALUE442,	VALUE443,	VALUE444,	VALUE445,	VALUE446,	VALUE447,	VALUE448,	VALUE449,	VALUE450,	VALUE451,	VALUE452,	VALUE453,	VALUE454,	VALUE455,	VALUE456,	VALUE457,	VALUE458,	VALUE459,	VALUE460,	VALUE461,	VALUE462,	VALUE463,	VALUE464,	VALUE465,	VALUE466,	VALUE467,	VALUE468,	VALUE469,	VALUE470,	VALUE471,	VALUE472,	VALUE473,	VALUE474,	VALUE475,	VALUE476,	VALUE477,	VALUE478,	VALUE479,	VALUE480,	VALUE481,	VALUE482,	VALUE483,	VALUE484,	VALUE485,	VALUE486,	VALUE487,	VALUE488,	VALUE489,	VALUE490,	VALUE491,	VALUE492,	VALUE493,	VALUE494,	VALUE495,	VALUE496,	VALUE497,	VALUE498,	VALUE499,	VALUE500,	VALUE501,	VALUE502,	VALUE503,	VALUE504,	VALUE505,	VALUE506,	VALUE507,	VALUE508,	VALUE509,	VALUE510,	VALUE511,	VALUE512 " \
	"FROM FACE_FEATURES"


extern char selectUserName[64];

typedef struct fvalue{
	char username[64];
	char regdate[128];
	float features[FACED_FEATURE_LEN];
}FaceData;

extern std::vector<FaceData> fData;
#endif //_FACECOMMON_H